package com.qingcloud.adminbackend.entity.sysfunction;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.List;

/**
 * <p>
 * 系统功能表
 * </p>
 *
 * @author liyuhong
 * @since 2018-11-16
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("sys_function")
public class SysFunction extends Model {

    private static final long serialVersionUID = 1L;

    private String id;
    /**
     * 菜单所属模块名称
     */
    @ApiModelProperty(value = "菜单所属模块名称", example = "")
    private String functionModule;

    /**
     * 唯一编号
     */
    @ApiModelProperty(value = "唯一编号", example = "")
    @TableField(value = "`code`")
    private String code;

    /**
     * 权限名称
     */
    @ApiModelProperty(value = "权限名称", example = "")
    private String functionName;

    /**
     * 权限名称
     */
    @ApiModelProperty(value = "权限名称英文", example = "")
    private String functionNameEn;

    /**
     * 权限类型 1菜单 2页面 3按钮
     */
    @ApiModelProperty(value = "权限类型 1菜单 2页面 3按钮", example = "")
    private String functionType;

    @ApiModelProperty(value = "等级", example = "")
    private String functionLevel;

    /**
     * 1:网格化菜单；2：健康云菜单
     */
    @ApiModelProperty(value = "1:网格化菜单；2：健康云菜单", example = "")
    private Integer menuType;

    /**
     * 链接地址
     */
    @ApiModelProperty(value = "链接地址", example = "")
    private String functionUrl;

    /**
     * 父ID
     */
    @ApiModelProperty(value = "父ID", example = "")
    private String parentId;

    /**
     * 删除标识
     */
    @ApiModelProperty(value = "删除标识", example = "0")
    private Integer deleteFlag;

    /**
     * 菜单图标
     */
    @ApiModelProperty(value = "菜单图标", example = "")
    private String icon;

    /**
     * 序号
     */
    @ApiModelProperty(value = "序号", example = "")
    private Integer orderNo;

    private String createDt;

    private String createBy;

    private String modifyDt;

    private String modifyBy;

    @ApiModelProperty(value = "是否是从自身身份来的功能条目", example = "1")
    @TableField(exist = false)
    private Integer roleFlag;

    @Data
    public static class RequestOrderParam implements Serializable {

        @ApiModelProperty(value = "排序后的对象数组")
        private List<FunctionOrderParam> functionList;
    }

    @Data
    public static class RequestEnableParam implements Serializable {

        @ApiModelProperty(value = "修改后的对象数组")
        private List<FunctionEnableParam> functionList;
    }

    /**
     * 新建分类参数对象
     */
    @Getter
    @Setter
    public static class FunctionOrderParam implements Serializable {

        @ApiModelProperty(value = "功能Id")
        private String functionId;

        @ApiModelProperty(value = "排序序号")
        private Integer orderNo;

    }

    /**
     * 新建分类参数对象
     */
    @Getter
    @Setter
    public static class FunctionEnableParam implements Serializable {

        @ApiModelProperty(value = "功能Id")
        private String functionId;

        @ApiModelProperty(value = "删除标识（0：未删除，1：删除）")
        private Integer deleteFlag;

    }


}
